package com.sgb.kjwl.view.ui.adapter.shopping;

import android.content.Context;
import android.widget.ImageView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.shopping.ShopMyPriceListEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;
import java.util.List;

public class ShopMyPriceAdapter extends BaseRecycleAdapter<ShopMyPriceListEntity> {

    public ShopMyPriceAdapter(Context context, List<ShopMyPriceListEntity> datas) {
        super(context, R.layout.item_shop_my_price, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, ShopMyPriceListEntity shopMyPriceListEntity) {
        holder.setBinding(BR.viewModel,shopMyPriceListEntity);
       ImageView price_status = holder.itemView.findViewById(R.id.price_status);
        //待报价，已报价，已失效
        if (shopMyPriceListEntity.getStatus().equals("1")){
            price_status.setImageResource(R.mipmap.to_be_quoted);
        }else if (shopMyPriceListEntity.getStatus().equals("2")) {
            price_status.setImageResource(R.mipmap.quoted);
        } else if (shopMyPriceListEntity.getStatus().equals("4")) {
            price_status.setImageResource(R.mipmap.expired);
        }
    }
}
